HAL IWDG types migration

HAL IWDG callback ID type definition

HAL1

HAL2

typedef enum
{
  HAL_IWDG_EWI_CB_ID,
  HAL_IWDG_MSPINIT_CB_ID
} HAL_IWDG_CallbackIDTypeDef;

Removed, The callback registration in HAL2 is handled by specific functions for each IWDG event. See HAL IWDG callback register functions for more details. HAL_IWDG_MSPINIT_CB_ID is removed because the function HAL_WWDG_MspInit is removed.

Related concept: Individual callback registration APIs replace global register and unregister functions


HAL IWDG initialization type definition

In HAL2, the IWDG_InitTypeDef structure has been deleted. The prescaler, Reload, and Window values are now calculated using private functions.

HAL1

HAL2

typedef struct
{
    uint32_t Prescaler;
    uint32_t Reload;
    uint32_t Window;
    uint32_t EWI;
} IWDG_InitTypeDef;

Removed, The values of prescaler, window, reload, and the early wakeup interrupt mode are now calculated and configured based on the input parameters of the function HAL_IWDG_Start().


HAL IWDG handle type definition

In HAL2, the HAL IWDG handle structure has been renamed from IWDG_HandleTypeDef to hal_iwdg_handle_t.

HAL1

HAL2

IWDG_HandleTypeDef
hal_iwdg_handle_t

Related concept: Renaming of the handle structure


HAL IWDG callback type definition

HAL1

HAL2

pIWDG_CallbackTypeDef

hal_iwdg_cb_t

Related concept: Replaced TypeDef suffix with _t in type names